package com.rock.upms.autocode.generator;

import java.io.File;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import com.rock.upms.autocode.util.MybatisGeneratUtil;


/**
 * @author hotdog
 *
 */
public class GeneratorUpmsWeb {

	/**
	 * 生成web相关代码，包括 controller以及列表展现和增删改查的jsp页面（增删改查为模态窗口形式，所以只有一个jsp文件）
	 * @param args
	 * @throws Exception 
	 */
	public static void main(String[] args) throws Exception {
		String projectFolderPath = new File("").getCanonicalPath().replace("\\", "/");
		System.out.println(projectFolderPath);
		// 需要insert后返回主键的表配置，key:表名,value:主键名。其余的有自定义主键返回
		 Map<String, String> return_insert_id_tables = new HashMap<String,String>();
		 return_insert_id_tables.put("upms_keytable", "id");
		 MybatisGeneratUtil generator = new MybatisGeneratUtil();
		//生成upms_permission表CRUD==========begin=========
		String tableName = "upms_permission";
		String pkCode = "id";
		String tableComment = "系统信息";
		String subSystemCode = "system";
		Set<String> hideColumnSet = new HashSet<>();
		hideColumnSet.add("id");
		generator.generatWebModal(tableName, pkCode, tableComment, subSystemCode, hideColumnSet);
		//生成upms_permission表CRUD==========end=========
	}
	
	/**
	 * @param tt
	 */
	public void test (String tt){
		System.out.println("tt");
	}
}
